﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace GBPVRLibrary.MetadataLibrary.TheTVDBInterface
{
    public class TheTVDBBanner:TheTVDBItem
    {
        public enum BannerType { FanArt = 1, Season = 2, Series = 4, Poster = 8 }

        public string BannerUrl { get; set; }
        public Image Banner { get; set; }
        public BannerType Type { get; set; }

        public TheTVDBBanner() { }

        public TheTVDBBanner(string ThumbnailPath)
        {
            try 
            {
                if(!String.IsNullOrEmpty(ThumbnailPath))
                    this.Thumbnail = WebSiteHelper.DownloadImage(ThumbnailPath);
            }
            catch (Exception) { }
        }

        public Image DownloadBanner()
        {
            try
            {
                return WebSiteHelper.DownloadImage(BannerUrl);
            }
            catch (Exception)
            {
                return null;
            }
        }
    }
}
